home *** CD-ROM | disk | FTP | other *** search
- package arka;
-
- import java.io.IOException;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- public class Displayable1 extends Canvas {
- Image background;
- Image contin;
- boolean contini = false;
- Command quit = new Command("Quit", 6, 1);
- Command continu = new Command("Continue", 8, 1);
-
- public Displayable1() {
- ((Displayable)this).setCommandListener(new 1(this));
-
- try {
- this.jbInit();
- } catch (Exception e) {
- ((Throwable)e).printStackTrace();
- }
-
- }
-
- private void jbInit() throws Exception {
- try {
- this.background = Image.createImage("/arka/titl.png");
- this.contin = Image.createImage("/arka/continge.png");
- } catch (IOException e) {
- System.out.println(((Throwable)e).getMessage());
- }
-
- ((Displayable)this).addCommand(this.quit);
- ((Displayable)this).addCommand(this.continu);
- }
-
- public void this_commandPerformed(Command c, Displayable d) {
- if (c.getCommandType() == 6) {
- MIDlet1.quitApp();
- }
-
- if (c.getCommandType() == 8) {
- this.contini = true;
- ((Displayable)this).removeCommand(this.continu);
- ((Displayable)this).addCommand(new Command("Play", 4, 1));
- ((Canvas)this).repaint();
- }
-
- if (c.getCommandType() == 4) {
- MIDlet1.startGame();
- }
-
- }
-
- protected void paint(Graphics g) {
- g.drawImage(this.background, 0, 0, 20);
- if (this.contini) {
- g.drawImage(this.contin, 17, 11, 20);
- }
-
- }
- }
-